import Vue from "vue";
import VueRouter from "vue-router";
import Home from "../components/Home.vue";
import Details from "../components/details.vue";
import shouye from "../components/shouye.vue";
// import login from "../components/select/login.vue"
import login from "../components/login.vue";
import register from "../components/register.vue";
import order from "../components/order.vue";
import homeuse from "../components/select/homeuse.vue";


Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    component: Home,
    redirect: "/shouye",
    children: [
      // 伟强的路由
      {
        path: "trolley",
        component: () => import("../commerce/ShoppingTrolley.vue"),
      },
      {
        path: "settle",
        component: () => import("../commerce/SettleAccounts.vue"),
      },
      {
        path: "Headpicture/:key",
        name: "Headpicture",
        component: () => import("../components/Headpicture.vue"),
      },
      {
        path: 'userinfo',
        component: () => import('../components/UserInfo')
      },
      // 跃彬的路由
      {
        path: "/details/:id/:url",
        name:"details",
        component: Details,
      },

      {
        path: "shouye",
        component: shouye,
      },
      {
        path: "/login",
        component: login,
      },
      {
        path: "/register",
        component: register,
      },
      {
        path: "/order",
        component: order,
      },
      {
        path: "/homeuse/:key",
        name: "home",
        component: homeuse,
      }
    ],
  },
];

const router = new VueRouter({
  routes,
});

export default router;
